package com.wiscamp.ninechapters.problems.application.dto.vo.types;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.wiscamp.ninechapters.ddd.ViewObject;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Collection;

/**
 * 题类型
 */
@Data
public class ProblemTypeVO implements ViewObject {
    /**
     * 题型编号
     */
    private long typeId = 0;

    /**
     * 学科编号
     */
    private long subjectId = 0;

    /**
     * 题型代码
     */
    private String typeCode = "";

    /**
     * 题型名称
     */
    private String typeName = "";

    /**
     * 题型说明
     */
    private String typeDescription = "";

    /**
     * 是否有题干部分
     */
    private boolean hasStem = false;

    /**
     * 题干类型
     * 参考 panels.data_dictionary: STEM_TYPE
     */
    private int stemTypeId = 0;

    /**
     * 题模式
     */
    private int problemModeId = 0;

    /**
     * 通用问题模式
     */
    private int commonQuestionModeId;

    /**
     * 备注
     */
    private String remark = "";

    /**
     * 是否可用
     */
    private boolean enabled = true;

    /**
     * 创建用户
     */
    private long creatorId = 0;

    /**
     * 创建时间
     */
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime creationTime;

    /**
     * 编辑用户
     */
    private long modifierId = 0;

    /**
     * 编辑时间
     */
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime modificationTime;

    private String subjectName = "";

    private String stemTypeName = "";

    private String problemModeName = "";

    private String commonQuestionModeName = "";

    private String creatorName = "";

    private String modifierName = "";

    /**
     * 问题题型类型
     */
    private Collection<QuestionTypeVO> questionTypes = new ArrayList<>();
}
